<?
Class sitemap
{
	var $ankor=array();
	function addkey($ankor,$link,$file){
		$this->ankor[]=array(
			'ankor'=>$ankor,
			'url'=>$link.$file);
	}
	function XML($patch){
		$content='';
		$content='<?xml version="1.0" encoding="UTF-8"?>
		<urlset
			  xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
			  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			  xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
					http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">'; 

		foreach($this->ankor as $id=>$val){
		  $content.="<url><loc>".$val['url']."</loc></url>";
		}
		$content.='</urlset>';
		
		$wFile=fopen($patch,'w');
		fwrite($wFile,$content);
		fclose($wFile);
		return true;
	}
	function HTML($patch,$template){
		$wFile=fopen($patch,'w');
		ob_start();
		include($template);
		$goodout=ob_get_contents();
		ob_end_clean();
		fwrite($wFile,$goodout);
		fclose($wFile);
		return true;
	}
}
?>